define([], function(){
	var tpl = {};

	tpl.tenantInit = function(domId){
		var html = tenant();
		$("#"+domId).html(html);
	}
	var tenant = function(){
		return 	'<script id="tpl_cache_tenant" type="text/html">'+
				'	<li class="dropdown">'+	
				'		{{each apps as app i}}'+
				'			{{if i == 0}}'+
			    '				<a href="#">'+	
			   	'					<label class="logo-icon" style="background:#e0ecea url({{app.tenantIcon}})"></label>'+	
			    '					<span class="hidden-xs tenant_name">{{app.tenantName}}</span>'+	
			    '				</a>'+
			    '			{{/if}}'+
			    '		{{/each}}'+
			    '	</li>'+
			    '</script>';
	}

	tpl.navbarInit = function(domId){
		var html = navbar();
		$("#"+domId).html(html);
	}
	var navbar = function(){
		return 	'<script id="tpl_cache_navbar" type="text/html">'+
				'	{{each navs as nav i}}'+
				'		<li>'+
				'			<a data-id="{{nav.menuId}}" data-icon="{{nav.menuIcon}}">'+
				'				<i class="{{nav.menuIcon}}"></i>'+
				'				<span>{{nav.menuName}}</span>'+
				'			</a>'+
				'		</li>'+
				'	{{/each}}'+
			    '</script>';
	}

	tpl.initCrumb = function(domId){
		var html = crumb();
		$("#"+domId).html(html);
	}
	var crumb = function(){
		return 	'<script id="tpl_cache_crumb" type="text/html">'+
				'	<ol class="breadcrumb">'+
				'		{{each crumbs as crumb i}}'+
				'			<li class="active">'+
				'				{{if i==0}}'+
				'					<i class="{{crumb.menuIcon}}"></i>'+
				'				{{/if}}'+
				'				{{crumb.menuName}}'+
				'			</li>'+
				'		{{/each}}'+
				'	</ol>'+
			    '</script>';
	}

	tpl.initError = function(domId){
		var html = error();
		$("#"+domId).html(html);
	}
	var error = function(){
		return 	'<script id="tpl_cache_error" type="text/html">'+
				'	<div class="lc-content-error">'+
				'		<div class="content">'+
				'			<i class="icon-exclamation-sign"></i>'+
				'			{{content}}'+
				'		</div>'+
				'	</div>'+
			    '</script>';
	}








	tpl.initLoading = function(domId){
		var html = loading();
		$("#"+domId).html(html);
	}
	tpl.initTopbar = function(domId){
		var html = topbar();
		$("#"+domId).html(html);
	}
	var loading = function(){
		return 	'<script id="tpl_loading" type="text/html">'+
				'	<div class="lc-content-loading">'+
				'		<div class="loader-inner ball-pulse">'+
				'			<div></div>'+
				'			<div></div>'+
				'			<div></div>'+
				'		</div>'+
				'	</div>'+
			    '</script>';
	}
	var topbar = function(){
		return 	'<script id="tpl_topbar" type="text/html">'+
				'	<ul>'+
				'		{{each topbars as topbar i}}'+
				'			<li><i class="{{topbar.icon}}"></i>{{topbar.name}}</li>'+
				'		{{/each}}'+
				'	</ul>'+
			    '</script>';
	}

	return tpl;
});